package groep3.ssc.skaterViews;

import groep3.ssc.main.R;
import groep3.ssc.model.Race;
import android.content.Context;
import android.content.res.Resources;

public class RoundNumberView extends SkaterViewTemplate
{
    public SkaterTextView lapNumber;

    public RoundNumberView(Context context)
    {
        super(context);
        lapNumber = new SkaterTextView(context);
        addView(lapNumber);
        subscribeToController();
    }

    @Override
    public void update(Race model)
    {
        Resources res = getResources();
        String roundAbbreviationString = res.getString(R.string.txtRoundAbbreviationString);
        this.lapNumber.setText(roundAbbreviationString + ":" + model.getSkater(model.getOurSkater()).getRoundNumber());
    }

    @Override
    protected void onSizeChanged(int w, int h, int oldw, int oldh)
    {
        super.onSizeChanged(w, h, oldw, oldh);
    }

    @Override
    public String toString()
    {
        Resources res = getResources();
        String txtRoundNumber = res.getString(R.string.txtRoundNumber);
        return txtRoundNumber;
    }
}
